import { defHttp } from "@/utils/http";
import { baseUrlApi } from "./utils";

/** 采购申请列表带分页 */
export const setPurchaseApplyPageList = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/apply/pagelist"),
    data
  });
};

/** 采购申请详情 */
export const getPurchaseApplyDetail = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/apply/detail"),
    data
  });
};

/** 新增采购申请 */
export const setPurchaseApplyAdd = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/apply/add"),
    data
  });
};

/** 采购计划明细 */
export const setPurchaseApplyPurchasePlanDetail = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/apply/purchasePlanDetail"),
    data
  });
};

/** 采购入库单列表带分页 */
export const getPurchaseInboundPageList = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/inbound/pagelist"),
    data
  });
};

/** 采购入库单详情 */
export const getPurchaseInboundDetail = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/inbound/detail"),
    data
  });
};

/** 新增采购入库 */
export const setPurchaseInboundAdd = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/inbound/add"),
    data
  });
};

/** 采购订单仓库列表 */
export const getPurchaseInboundWarehouseList = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/inbound/warehouseList"),
    data
  });
};

/** 采购订单物料明细 */
export const getPurchaseOrderItemDetail = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/order/itemDetail"),
    data
  });
};

/** 采购订单列表带分页 */
export const setPurchaseOrderPageList = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/order/pageList"),
    data
  });
};

/** 采购订单详情 */
export const setPurchaseOrderDetail = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/order/detail"),
    data
  });
};

/** 修改采购订单 */
export const setPurchaseOrderUpdate = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/order/update"),
    data
  });
};

/** 发货保存 */
export const setPurchaseOrderDeliver = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/order/deliver"),
    data
  });
};

/** 批量发货 */
export const setPurchaseOrderBatchDeliver = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/order/batchDeliver"),
    data
  });
};

/** 采购计划单号列表获取 */
export const getPurchasePlanList = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/plan/list"),
    data
  });
};

/** 采购单号列表获取 */
export const getPurchaseOrderList = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/order/list"),
    data
  });
};

/** 采购入库单号列表获取 */
export const getInboundPurchaseOrderItemDetail = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/inbound/purchaseOrderItemDetail"),
    data
  });
};
/** 退供出库单列表带分页 */
export const getPurchaseOutboundPageList = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/outbound/pagelist"),
    data
  });
};
/** 退供出库单详情 */
export const getPurchaseOutboundDetail = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/outbound/detail"),
    data
  });
};
/** 新增退供出库 */
export const setPurchaseOutboundAdd = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/outbound/add"),
    data
  });
};
/** 净入库明细 */
export const getPurchaseOrderBoundDetail = <T>(data?: object) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/order/boundDetail"),
    data
  });
};

/** 根据采购订单号查询采购入库单详情 */
export const getPurchaseOutboundDetailByPurchaseOrderCode = <T>(
  data?: object
) => {
  return defHttp.post<T>({
    url: baseUrlApi("/purchase/outbound/queryByPurchaseOrderCode"),
    data
  });
};
